<?php

/**
 * @file z_label.php
 * @brief Clase para generar una etiqueta
 * @author DyrTechnologies
 * @version V 1.0
 * @date Wed Dec 05 2007
 *
 *  Part of the CEFIRO dynamic web framework project
 *
 *  Copyright (C) 2007  Dyr technologies http://dyrtech.com.ve
 *
 *  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

if (!defined('CEFIRO')) define("CEFIRO",substr(__FILE__,0,strpos(__FILE__,"cefiro"))."cefiro/widgets/cefiro.php");
require_once(CEFIRO);
require_once(CEF_FORMBUTTONS);

function getFormButtons($args){
	
	$theFormButtons = new formbuttons('cefformbuttons');
	$theFormButtons->set_left_text('Accept');
	$theFormButtons->set_right_text('Cancel');
	
	$left_opt = new input_opt();	
	$left_opt->set_onClic("alert('Accepted!');");	
	$theFormButtons->set_left_opt($left_opt);
	
	$right_opt = new input_opt();	
	$right_opt->set_onClic("alert('Canceled!');");	
	$theFormButtons->set_right_opt($right_opt);
	
	
	$theFormButtons->display_formbuttons();
  	
	global $smarty;
  	$smarty->template_dir = dirname(__FILE__).'/';

  	addAssign('widgetTitle','innerHTML',"<p class='title_blue'>Form Buttons</p>");
  	addAssign('widgetDisplay','innerHTML',$smarty->fetch('z_formbuttons.tpl'));

	$src  = "<p>";	
	$src .= "\$theFormButtons = new formbuttons('cefformbuttons');<br>";
	$src .= "\$theFormButtons->set_left_text('Accept');<br>";
	$src .= "\$theFormButtons->set_right_text('Cancel');<br>";
	$src .= "\$left_opt = new input_opt();<br>";
	$src .= "\$left_opt->set_onClic(\"alert('Accepted!');\");<br>";
	$src .= "\$theFormButtons->set_left_opt(\$left_opt);<br>";
	$src .= "\$right_opt = new input_opt();<br>";
	$src .= "\$right_opt->set_onClic(\"alert('Canceled!');\");<br>";
	$src .= "\$theFormButtons->set_right_opt(\$right_opt);<br>";
	
	
	$src .= "\$theFormButtons->display_formbuttons();<br>";
	$src .= "</p>";

	addAssign('srcTitle','innerHTML',"<p class='title_red'>Source</p>");
  	addAssign('srcDisplay','innerHTML',$src);

  	addAssign('tplTitle','innerHTML',"<p class='title_green'>Smarty Template</p>");
  	addAssign('tplDisplay','innerHTML',"<p>{\$cefformbuttons}</p>");

  	return processResponse();
}

?>